import openpyxl
from openpyxl.workbook import Workbook
from openpyxl.worksheet.worksheet import Worksheet


class DoBiaoGe():

    def doExeRead(self,f,sname,minr,maxr,minc,maxc):
        wk:Workbook=openpyxl.load_workbook(f)
        #获取sheet对象
        st:Worksheet = wk[sname]
        #指定读取部分内容
        w=st.iter_rows(minr,maxr,minc,maxc,values_only=True)
        l=[i for i in w]
        print(l)
        return l

if __name__=='__main__':
    d=DoBiaoGe()
    f=r'D:\软测\新建文件夹\3-18 python\day05\data\yunSuanData.xlsx'
    d.doExeRead(f,'sum',2,11,2,5)









